Optimal. Leaf size=71 \[ \frac {6 d^2 (c+d x) \cos (a+b x)}{b^3}-\frac {(c+d x)^3 \cos (a+b x)}{b}-\frac {6 d^3 \sin (a+b x)}{b^4}+\frac {3 d (c+d x)^2 \sin (a+b x)}{b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3377, 2717}
\begin {gather*} -\frac {6 d^3 \sin (a+b x)}{b^4}+\frac {6 d^2 (c+d x) \cos (a+b x)}{b^3}+\frac {3 d (c+d x)^2 \sin (a+b x)}{b^2}-\frac {(c+d x)^3 \cos (a+b x)}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 3377
Rubi steps
\begin {align*} \int (c+d x)^3 \sin (a+b x) \, dx &=-\frac {(c+d x)^3 \cos (a+b x)}{b}+\frac {(3 d) \int (c+d x)^2 \cos (a+b x) \, dx}{b}\\ &=-\frac {(c+d x)^3 \cos (a+b x)}{b}+\frac {3 d (c+d x)^2 \sin (a+b x)}{b^2}-\frac {\left (6 d^2\right ) \int (c+d x) \sin (a+b x) \, dx}{b^2}\\ &=\frac {6 d^2 (c+d x) \cos (a+b x)}{b^3}-\frac {(c+d x)^3 \cos (a+b x)}{b}+\frac {3 d (c+d x)^2 \sin (a+b x)}{b^2}-\frac {\left (6 d^3\right ) \int \cos (a+b x) \, dx}{b^3}\\ &=\frac {6 d^2 (c+d x) \cos (a+b x)}{b^3}-\frac {(c+d x)^3 \cos (a+b x)}{b}-\frac {6 d^3 \sin (a+b x)}{b^4}+\frac {3 d (c+d x)^2 \sin (a+b x)}{b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 62, normalized size = 0.87 \begin {gather*} \frac {-b (c+d x) \left (-6 d^2+b^2 (c+d x)^2\right ) \cos (a+b x)+3 d \left (-2 d^2+b^2 (c+d x)^2\right ) \sin (a+b x)}{b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(307\) vs.
\(2(71)=142\).
time = 0.06, size = 308, normalized size = 4.34
method | result | size |
risch | \(-\frac {\left (b^{2} d^{3} x^{3}+3 b^{2} c \,d^{2} x^{2}+3 b^{2} c^{2} d x +b^{2} c^{3}-6 d^{3} x -6 c \,d^{2}\right ) \cos \left (b x +a \right )}{b^{3}}+\frac {3 d \left (d^{2} x^{2} b^{2}+2 b^{2} c d x +b^{2} c^{2}-2 d^{2}\right ) \sin \left (b x +a \right )}{b^{4}}\) | \(108\) |
norman | \(\frac {\frac {\left (2 b^{2} c^{3}-12 c \,d^{2}\right ) \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{3}}+\frac {d^{3} x^{3} \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}-\frac {d^{3} x^{3}}{b}-\frac {3 d \left (b^{2} c^{2}-2 d^{2}\right ) x}{b^{3}}-\frac {3 c \,d^{2} x^{2}}{b}+\frac {6 d \left (b^{2} c^{2}-2 d^{2}\right ) \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b^{4}}+\frac {6 d^{3} x^{2} \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b^{2}}+\frac {3 d \left (b^{2} c^{2}-2 d^{2}\right ) x \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{3}}+\frac {3 c \,d^{2} x^{2} \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {12 c \,d^{2} x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b^{2}}}{1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )}\) | \(233\) |
derivativedivides | \(\frac {\frac {a^{3} d^{3} \cos \left (b x +a \right )}{b^{3}}-\frac {3 a^{2} c \,d^{2} \cos \left (b x +a \right )}{b^{2}}+\frac {3 a^{2} d^{3} \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )\right )}{b^{3}}+\frac {3 a \,c^{2} d \cos \left (b x +a \right )}{b}-\frac {6 a c \,d^{2} \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )\right )}{b^{2}}-\frac {3 a \,d^{3} \left (-\left (b x +a \right )^{2} \cos \left (b x +a \right )+2 \cos \left (b x +a \right )+2 \left (b x +a \right ) \sin \left (b x +a \right )\right )}{b^{3}}-c^{3} \cos \left (b x +a \right )+\frac {3 c^{2} d \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )\right )}{b}+\frac {3 c \,d^{2} \left (-\left (b x +a \right )^{2} \cos \left (b x +a \right )+2 \cos \left (b x +a \right )+2 \left (b x +a \right ) \sin \left (b x +a \right )\right )}{b^{2}}+\frac {d^{3} \left (-\left (b x +a \right )^{3} \cos \left (b x +a \right )+3 \left (b x +a \right )^{2} \sin \left (b x +a \right )-6 \sin \left (b x +a \right )+6 \left (b x +a \right ) \cos \left (b x +a \right )\right )}{b^{3}}}{b}\) | \(308\) |
default | \(\frac {\frac {a^{3} d^{3} \cos \left (b x +a \right )}{b^{3}}-\frac {3 a^{2} c \,d^{2} \cos \left (b x +a \right )}{b^{2}}+\frac {3 a^{2} d^{3} \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )\right )}{b^{3}}+\frac {3 a \,c^{2} d \cos \left (b x +a \right )}{b}-\frac {6 a c \,d^{2} \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )\right )}{b^{2}}-\frac {3 a \,d^{3} \left (-\left (b x +a \right )^{2} \cos \left (b x +a \right )+2 \cos \left (b x +a \right )+2 \left (b x +a \right ) \sin \left (b x +a \right )\right )}{b^{3}}-c^{3} \cos \left (b x +a \right )+\frac {3 c^{2} d \left (\sin \left (b x +a \right )-\left (b x +a \right ) \cos \left (b x +a \right )\right )}{b}+\frac {3 c \,d^{2} \left (-\left (b x +a \right )^{2} \cos \left (b x +a \right )+2 \cos \left (b x +a \right )+2 \left (b x +a \right ) \sin \left (b x +a \right )\right )}{b^{2}}+\frac {d^{3} \left (-\left (b x +a \right )^{3} \cos \left (b x +a \right )+3 \left (b x +a \right )^{2} \sin \left (b x +a \right )-6 \sin \left (b x +a \right )+6 \left (b x +a \right ) \cos \left (b x +a \right )\right )}{b^{3}}}{b}\) | \(308\) |
meijerg | \(\frac {8 d^{3} \sqrt {\pi }\, \cos \left (a \right ) \left (\frac {x b \left (-\frac {5 x^{2} b^{2}}{2}+15\right ) \cos \left (b x \right )}{20 \sqrt {\pi }}-\frac {\left (-\frac {15 x^{2} b^{2}}{2}+15\right ) \sin \left (b x \right )}{20 \sqrt {\pi }}\right )}{b^{4}}+\frac {8 d^{3} \sqrt {\pi }\, \sin \left (a \right ) \left (\frac {3}{4 \sqrt {\pi }}-\frac {\left (-\frac {3 x^{2} b^{2}}{2}+3\right ) \cos \left (b x \right )}{4 \sqrt {\pi }}-\frac {x b \left (-\frac {x^{2} b^{2}}{2}+3\right ) \sin \left (b x \right )}{4 \sqrt {\pi }}\right )}{b^{4}}+\frac {12 c \,d^{2} \sqrt {\pi }\, \cos \left (a \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (-\frac {x^{2} b^{2}}{2}+1\right ) \cos \left (b x \right )}{2 \sqrt {\pi }}+\frac {x b \sin \left (b x \right )}{2 \sqrt {\pi }}\right )}{b^{3}}+\frac {12 c \,d^{2} \sqrt {\pi }\, \sin \left (a \right ) \left (\frac {x \left (b^{2}\right )^{\frac {3}{2}} \cos \left (b x \right )}{2 \sqrt {\pi }\, b^{2}}-\frac {\left (b^{2}\right )^{\frac {3}{2}} \left (-\frac {3 x^{2} b^{2}}{2}+3\right ) \sin \left (b x \right )}{6 \sqrt {\pi }\, b^{3}}\right )}{b^{2} \sqrt {b^{2}}}+\frac {6 d \,c^{2} \sqrt {\pi }\, \cos \left (a \right ) \left (-\frac {x b \cos \left (b x \right )}{2 \sqrt {\pi }}+\frac {\sin \left (b x \right )}{2 \sqrt {\pi }}\right )}{b^{2}}+\frac {6 d \,c^{2} \sqrt {\pi }\, \sin \left (a \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cos \left (b x \right )}{2 \sqrt {\pi }}+\frac {x b \sin \left (b x \right )}{2 \sqrt {\pi }}\right )}{b^{2}}+\frac {c^{3} \sqrt {\pi }\, \cos \left (a \right ) \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (b x \right )}{\sqrt {\pi }}\right )}{b}+\frac {c^{3} \sin \left (a \right ) \sin \left (b x \right )}{b}\) | \(343\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 285 vs.
\(2 (71) = 142\).
time = 0.32, size = 285, normalized size = 4.01 \begin {gather*} -\frac {c^{3} \cos \left (b x + a\right ) - \frac {3 \, a c^{2} d \cos \left (b x + a\right )}{b} + \frac {3 \, a^{2} c d^{2} \cos \left (b x + a\right )}{b^{2}} - \frac {a^{3} d^{3} \cos \left (b x + a\right )}{b^{3}} + \frac {3 \, {\left ({\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right )} c^{2} d}{b} - \frac {6 \, {\left ({\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right )} a c d^{2}}{b^{2}} + \frac {3 \, {\left ({\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right )} a^{2} d^{3}}{b^{3}} + \frac {3 \, {\left ({\left ({\left (b x + a\right )}^{2} - 2\right )} \cos \left (b x + a\right ) - 2 \, {\left (b x + a\right )} \sin \left (b x + a\right )\right )} c d^{2}}{b^{2}} - \frac {3 \, {\left ({\left ({\left (b x + a\right )}^{2} - 2\right )} \cos \left (b x + a\right ) - 2 \, {\left (b x + a\right )} \sin \left (b x + a\right )\right )} a d^{3}}{b^{3}} + \frac {{\left ({\left ({\left (b x + a\right )}^{3} - 6 \, b x - 6 \, a\right )} \cos \left (b x + a\right ) - 3 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \sin \left (b x + a\right )\right )} d^{3}}{b^{3}}}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 110, normalized size = 1.55 \begin {gather*} -\frac {{\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + b^{3} c^{3} - 6 \, b c d^{2} + 3 \, {\left (b^{3} c^{2} d - 2 \, b d^{3}\right )} x\right )} \cos \left (b x + a\right ) - 3 \, {\left (b^{2} d^{3} x^{2} + 2 \, b^{2} c d^{2} x + b^{2} c^{2} d - 2 \, d^{3}\right )} \sin \left (b x + a\right )}{b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 202 vs.
\(2 (70) = 140\).
time = 0.23, size = 202, normalized size = 2.85 \begin {gather*} \begin {cases} - \frac {c^{3} \cos {\left (a + b x \right )}}{b} - \frac {3 c^{2} d x \cos {\left (a + b x \right )}}{b} - \frac {3 c d^{2} x^{2} \cos {\left (a + b x \right )}}{b} - \frac {d^{3} x^{3} \cos {\left (a + b x \right )}}{b} + \frac {3 c^{2} d \sin {\left (a + b x \right )}}{b^{2}} + \frac {6 c d^{2} x \sin {\left (a + b x \right )}}{b^{2}} + \frac {3 d^{3} x^{2} \sin {\left (a + b x \right )}}{b^{2}} + \frac {6 c d^{2} \cos {\left (a + b x \right )}}{b^{3}} + \frac {6 d^{3} x \cos {\left (a + b x \right )}}{b^{3}} - \frac {6 d^{3} \sin {\left (a + b x \right )}}{b^{4}} & \text {for}\: b \neq 0 \\\left (c^{3} x + \frac {3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac {d^{3} x^{4}}{4}\right ) \sin {\left (a \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.77, size = 111, normalized size = 1.56 \begin {gather*} -\frac {{\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{2} d x + b^{3} c^{3} - 6 \, b d^{3} x - 6 \, b c d^{2}\right )} \cos \left (b x + a\right )}{b^{4}} + \frac {3 \, {\left (b^{2} d^{3} x^{2} + 2 \, b^{2} c d^{2} x + b^{2} c^{2} d - 2 \, d^{3}\right )} \sin \left (b x + a\right )}{b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.62, size = 147, normalized size = 2.07 \begin {gather*} \frac {\cos \left (a+b\,x\right )\,\left (6\,c\,d^2-b^2\,c^3\right )}{b^3}-\frac {3\,\sin \left (a+b\,x\right )\,\left (2\,d^3-b^2\,c^2\,d\right )}{b^4}-\frac {d^3\,x^3\,\cos \left (a+b\,x\right )}{b}+\frac {3\,d^3\,x^2\,\sin \left (a+b\,x\right )}{b^2}+\frac {3\,x\,\cos \left (a+b\,x\right )\,\left (2\,d^3-b^2\,c^2\,d\right )}{b^3}+\frac {6\,c\,d^2\,x\,\sin \left (a+b\,x\right )}{b^2}-\frac {3\,c\,d^2\,x^2\,\cos \left (a+b\,x\right )}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________